package com.weixing.mall.provider.api.fallback;

import com.weixing.mall.base.orm.MPage;
import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.provider.api.model.dto.LoginLogDto;
import com.weixing.mall.provider.api.model.dto.UserDto;
import com.weixing.mall.provider.api.model.dto.UserUpdateDto;
import com.weixing.mall.provider.api.model.vo.*;
import com.weixing.mall.provider.api.service.SysUserRpcService;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author wx
 * @Date 2019/12/13 10:26
 * @Version 1.0
 */
@Component
public class SysUserServiceFallback implements SysUserRpcService {
    @Override
    public Result<List<RoleVo>> getRoleById(Long id) {
        return null;
    }

    @Override
    public Result<List<SysUserAuthVo>> getUserListBydeptId(Long id) {
        return null;
    }

    @Override
    public Result<SysUserAuthVo> loadUserByUserName(String userName) {
        throw new RuntimeException();
//        return ResultUtil.error();
    }

    @Override
    public Result<UserInfoVo> userInfo(Long id) {
        return ResultUtil.error("CMS服务模块暂不可用");
    }


    @Override
    public Result<SysUserAuthVo> loadUserByMobile(String mobile) {
        return null;
    }

    @Override
    public Result updateUser(UserUpdateDto sysUser) {
        return ResultUtil.error();
    }

    @Override
    public Result saveLoginLog(LoginLogDto sysLoginLog) {
        return ResultUtil.error();
    }

    @Override
    public Result<List<KefuVo>> loadKefu() {
        return ResultUtil.error("查询客服报错");
    }

    @Override
    public Result<SysUserVo> getById(Long parentId) {
        return ResultUtil.error("查询客服报错");
    }

    @Override
    public Result<KefuVo> loadKefuById(Long id) {
        return null;
    }

    @Override
    public Result<SysUserVo> createUser(UserDto userDto) {
        return ResultUtil.error("新增用户失败");
    }

    @Override
    public Result<SysUserVo> selectByLoginName(String loginName) {
        return ResultUtil.error("查询用户报错");
    }

    @Override
    public Result<MPage<KefuVo>> selectKefuList(long currentPage, long pageSize) {
        return ResultUtil.error("查询客服列表报错");
    }

    @Override
    public Result<KefuVo> loadKefuByUserName(String loginName) {
        {
            return ResultUtil.error("查询客服报错");

        }
    }

    @Override
    public Result checkBind(Long customerId, Long appDepotId) {
        return ResultUtil.error("查询报错");
    }
}
